let getBannerUrl = '/banner';
let getContentUrl = '/content';
let getListUrl = '/list';
let getConfigUrl = '/config';
let getBlockUrl = '/block';
let getCatlistUrl = '/catlist';
// let getNavurl = '/nav';
let getTypeUrl = '/type';
let getFormUrl = '/form';

const install = (Vue, vm) => {
	// 列表api
	let getList = (params = {
		cid,
		limit,
		orderby,
		pages
	}) => vm.$u.post(getListUrl, params);
	// banner api
	let getBanner = (params = {type}) => vm.$u.post(getBannerUrl, params);
	// 详情api
	let getContent = (params = {
		id
	}) => vm.$u.post(getContentUrl, params);
	// 栏目api
	let getType = (params = {
		typeid
	}) => vm.$u.post(getTypeUrl, params);
	// 栏目分类api
	let getCatlist = (params = {
		cid,
		type
	}) => vm.$u.post(getCatlistUrl, params);
	// 表单api
	let getForm = (params = {
		__formid__,
		name,
		phone,
		desc,
		yuanwang
	}) => vm.$u.post(getFormUrl, params);
	// 系统配置api
	let getConfig = (params = {
		name
	}) => vm.$u.post(getConfigUrl, params);
	// 自定义块api-电话-自定义字段：tel
	let getBlockTel = (params = {}) => vm.$u.post(getBlockUrl, {
		name: 'tel'
	});
	// 自定义块api-自定义字段：dizhi
	let getBlockDizhi = (params = {}) => vm.$u.post(getBlockUrl, {
		name: 'dizhi'
	});
	// 自定义块api-自定义字段：mail
	let getBlockMail = (params = {}) => vm.$u.post(getBlockUrl, {
		name: 'mail'
	});

	vm.$u.api = {
		getList,
		getBanner,
		getType,
		getContent,
		getForm,
		getCatlist,
		getConfig,
		getBlockTel,
	};
}

export default {
	install,
}
